119 // Low slots are accessed by the StartNode::enum.
120 // Then come the locals at StartNode::Parms to StartNode::Parms+max_locals();
121 // Then come JVM stack slots.
122 // Finally come the monitors, if any.
123 // See layout accessors in class JVMState.
124
125 SafePointNode* map() const { return _map; }
126 bool has_exceptions() const { return _exceptions != NULL; }
127 JVMState* jvms() const { return map_not_null()->_jvms; }
128 int sp() const { return _sp; }
129 int bci() const { return _bci; }
130 Bytecodes::Code java_bc() const;
131 ciMethod* method() const { return _method; }
132
133 void set_jvms(JVMState* jvms) { set_map(jvms->map());
134 assert(jvms == this->jvms(), "sanity");
135 _sp = jvms->sp();
136 _bci = jvms->bci();
137 _method = jvms->has_method() ? jvms->method() : NULL; }
138 void set_map(SafePointNode* m) { _map = m; debug_only(verify_map()); }
139 void set_sp(int sp) { assert(sp >= 0, err_msg_res("sp must be non-negative: %d", sp)); _sp = sp; }
140 void clean_stack(int from_sp); // clear garbage beyond from_sp to top
141
142 void inc_sp(int i) { set_sp(sp() + i); }
143 void dec_sp(int i) { set_sp(sp() - i); }
144 void set_bci(int bci) { _bci = bci; }
145
146 // Make sure jvms has current bci & sp.
147 JVMState* sync_jvms() const;
148 JVMState* sync_jvms_for_reexecute();
149
150 #ifdef ASSERT
151 // Make sure JVMS has an updated copy of bci and sp.
152 // Also sanity-check method, depth, and monitor depth.
153 bool jvms_in_sync() const;
154
155 // Make sure the map looks OK.
156 void verify_map() const;
157
158 // Make sure a proposed exception state looks OK.
159 static void verify_exception_state(SafePointNode* ex_map);
337 Node* load_array_length(Node* array);
338
339
340 // Helper function to do a NULL pointer check or ZERO check based on type.
341 // Throw an exception if a given value is null.
342 // Return the value cast to not-null.
343 // Be clever about equivalent dominating null checks.
344 Node* null_check_common(Node* value, BasicType type,
345 bool assert_null = false,
346 Node* *null_control = NULL,
347 bool speculative = false);
348 Node* null_check(Node* value, BasicType type = T_OBJECT) {
349 return null_check_common(value, type, false, NULL, !_gvn.type(value)->speculative_maybe_null());
350 }
351 Node* null_check_receiver() {
352 assert(argument(0)->bottom_type()->isa_ptr(), "must be");
353 return null_check(argument(0));
354 }
355 Node* zero_check_int(Node* value) {
356 assert(value->bottom_type()->basic_type() == T_INT,
357 err_msg_res("wrong type: %s", type2name(value->bottom_type()->basic_type())));
358 return null_check_common(value, T_INT);
359 }
360 Node* zero_check_long(Node* value) {
361 assert(value->bottom_type()->basic_type() == T_LONG,
362 err_msg_res("wrong type: %s", type2name(value->bottom_type()->basic_type())));
363 return null_check_common(value, T_LONG);
364 }
365 // Throw an uncommon trap if a given value is __not__ null.
366 // Return the value cast to null, and be clever about dominating checks.
367 Node* null_assert(Node* value, BasicType type = T_OBJECT) {
368 return null_check_common(value, type, true);
369 }
370
371 // Null check oop. Return null-path control into (*null_control).
372 // Return a cast-not-null node which depends on the not-null control.
373 // If never_see_null, use an uncommon trap (*null_control sees a top).
374 // The cast is not valid along the null path; keep a copy of the original.
375 // If safe_for_replace, then we can replace the value with the cast
376 // in the parsing map (the cast is guaranteed to dominate the map)
377 Node* null_check_oop(Node* value, Node* *null_control,
378 bool never_see_null = false,
379 bool safe_for_replace = false,
380 bool speculative = false);
381
382 // Check the null_seen bit.
|
119 // Low slots are accessed by the StartNode::enum.
120 // Then come the locals at StartNode::Parms to StartNode::Parms+max_locals();
121 // Then come JVM stack slots.
122 // Finally come the monitors, if any.
123 // See layout accessors in class JVMState.
124
125 SafePointNode* map() const { return _map; }
126 bool has_exceptions() const { return _exceptions != NULL; }
127 JVMState* jvms() const { return map_not_null()->_jvms; }
128 int sp() const { return _sp; }
129 int bci() const { return _bci; }
130 Bytecodes::Code java_bc() const;
131 ciMethod* method() const { return _method; }
132
133 void set_jvms(JVMState* jvms) { set_map(jvms->map());
134 assert(jvms == this->jvms(), "sanity");
135 _sp = jvms->sp();
136 _bci = jvms->bci();
137 _method = jvms->has_method() ? jvms->method() : NULL; }
138 void set_map(SafePointNode* m) { _map = m; debug_only(verify_map()); }
139 void set_sp(int sp) { assert(sp >= 0, "sp must be non-negative: %d", sp); _sp = sp; }
140 void clean_stack(int from_sp); // clear garbage beyond from_sp to top
141
142 void inc_sp(int i) { set_sp(sp() + i); }
143 void dec_sp(int i) { set_sp(sp() - i); }
144 void set_bci(int bci) { _bci = bci; }
145
146 // Make sure jvms has current bci & sp.
147 JVMState* sync_jvms() const;
148 JVMState* sync_jvms_for_reexecute();
149
150 #ifdef ASSERT
151 // Make sure JVMS has an updated copy of bci and sp.
152 // Also sanity-check method, depth, and monitor depth.
153 bool jvms_in_sync() const;
154
155 // Make sure the map looks OK.
156 void verify_map() const;
157
158 // Make sure a proposed exception state looks OK.
159 static void verify_exception_state(SafePointNode* ex_map);
337 Node* load_array_length(Node* array);
338
339
340 // Helper function to do a NULL pointer check or ZERO check based on type.
341 // Throw an exception if a given value is null.
342 // Return the value cast to not-null.
343 // Be clever about equivalent dominating null checks.
344 Node* null_check_common(Node* value, BasicType type,
345 bool assert_null = false,
346 Node* *null_control = NULL,
347 bool speculative = false);
348 Node* null_check(Node* value, BasicType type = T_OBJECT) {
349 return null_check_common(value, type, false, NULL, !_gvn.type(value)->speculative_maybe_null());
350 }
351 Node* null_check_receiver() {
352 assert(argument(0)->bottom_type()->isa_ptr(), "must be");
353 return null_check(argument(0));
354 }
355 Node* zero_check_int(Node* value) {
356 assert(value->bottom_type()->basic_type() == T_INT,
357 "wrong type: %s", type2name(value->bottom_type()->basic_type()));
358 return null_check_common(value, T_INT);
359 }
360 Node* zero_check_long(Node* value) {
361 assert(value->bottom_type()->basic_type() == T_LONG,
362 "wrong type: %s", type2name(value->bottom_type()->basic_type()));
363 return null_check_common(value, T_LONG);
364 }
365 // Throw an uncommon trap if a given value is __not__ null.
366 // Return the value cast to null, and be clever about dominating checks.
367 Node* null_assert(Node* value, BasicType type = T_OBJECT) {
368 return null_check_common(value, type, true);
369 }
370
371 // Null check oop. Return null-path control into (*null_control).
372 // Return a cast-not-null node which depends on the not-null control.
373 // If never_see_null, use an uncommon trap (*null_control sees a top).
374 // The cast is not valid along the null path; keep a copy of the original.
375 // If safe_for_replace, then we can replace the value with the cast
376 // in the parsing map (the cast is guaranteed to dominate the map)
377 Node* null_check_oop(Node* value, Node* *null_control,
378 bool never_see_null = false,
379 bool safe_for_replace = false,
380 bool speculative = false);
381
382 // Check the null_seen bit.
|