Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 14174002: Added non observable side effects scope and removed unnecessary calls to AddSimulate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 stack_parameter_count = graph()->GetConstantMinus1(); 140 stack_parameter_count = graph()->GetConstantMinus1();
141 arguments_length_ = graph()->GetConstant0(); 141 arguments_length_ = graph()->GetConstant0();
142 } 142 }
143 143
144 context_ = new(zone) HContext(); 144 context_ = new(zone) HContext();
145 AddInstruction(context_); 145 AddInstruction(context_);
146 start_environment->BindContext(context_); 146 start_environment->BindContext(context_);
147 147
148 AddSimulate(BailoutId::StubEntry()); 148 AddSimulate(BailoutId::StubEntry());
149 149
150 NoObservableSideEffectsScope no_effects(this);
151
150 HValue* return_value = BuildCodeStub(); 152 HValue* return_value = BuildCodeStub();
151 153
152 // We might have extra expressions to pop from the stack in addition to the 154 // We might have extra expressions to pop from the stack in addition to the
153 // arguments above 155 // arguments above
154 HInstruction* stack_pop_count = stack_parameter_count; 156 HInstruction* stack_pop_count = stack_parameter_count;
155 if (descriptor_->function_mode_ == JS_FUNCTION_STUB_MODE) { 157 if (descriptor_->function_mode_ == JS_FUNCTION_STUB_MODE) {
156 HInstruction* amount = graph()->GetConstant1(); 158 HInstruction* amount = graph()->GetConstant1();
157 stack_pop_count = AddInstruction( 159 stack_pop_count = AddInstruction(
158 HAdd::New(zone, context_, stack_parameter_count, amount)); 160 HAdd::New(zone, context_, stack_parameter_count, amount));
159 stack_pop_count->ChangeRepresentation(Representation::Integer32()); 161 stack_pop_count->ChangeRepresentation(Representation::Integer32());
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 HType::JSObject(), 293 HType::JSObject(),
292 flags)); 294 flags));
293 295
294 for (int i = 0; i < size; i += kPointerSize) { 296 for (int i = 0; i < size; i += kPointerSize) {
295 HInstruction* value = 297 HInstruction* value =
296 AddInstruction(new(zone) HLoadNamedField(boilerplate, true, i)); 298 AddInstruction(new(zone) HLoadNamedField(boilerplate, true, i));
297 AddInstruction(new(zone) HStoreNamedField(object, 299 AddInstruction(new(zone) HStoreNamedField(object,
298 factory->empty_string(), 300 factory->empty_string(),
299 value, 301 value,
300 true, i)); 302 true, i));
301 AddSimulate(BailoutId::StubEntry());
302 } 303 }
303 304
304 builder.End(); 305 builder.End();
305 return object; 306 return object;
306 } 307 }
307 308
308 309
309 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { 310 Handle<Code> FastCloneShallowObjectStub::GenerateCode() {
310 return DoGenerateCode(this); 311 return DoGenerateCode(this);
311 } 312 }
(...skipping 13 matching lines...) Expand all
325 return DoGenerateCode(this); 326 return DoGenerateCode(this);
326 } 327 }
327 328
328 329
329 template <> 330 template <>
330 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { 331 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() {
331 BuildUncheckedMonomorphicElementAccess( 332 BuildUncheckedMonomorphicElementAccess(
332 GetParameter(0), GetParameter(1), GetParameter(2), NULL, 333 GetParameter(0), GetParameter(1), GetParameter(2), NULL,
333 casted_stub()->is_js_array(), casted_stub()->elements_kind(), 334 casted_stub()->is_js_array(), casted_stub()->elements_kind(),
334 true, casted_stub()->store_mode(), Representation::Tagged()); 335 true, casted_stub()->store_mode(), Representation::Tagged());
335 AddSimulate(BailoutId::StubEntry(), REMOVABLE_SIMULATE);
336 336
337 return GetParameter(2); 337 return GetParameter(2);
338 } 338 }
339 339
340 340
341 Handle<Code> KeyedStoreFastElementStub::GenerateCode() { 341 Handle<Code> KeyedStoreFastElementStub::GenerateCode() {
342 return DoGenerateCode(this); 342 return DoGenerateCode(this);
343 } 343 }
344 344
345 345
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 BuildCopyElements(context(), elements, 381 BuildCopyElements(context(), elements,
382 casted_stub()->from_kind(), new_elements, 382 casted_stub()->from_kind(), new_elements,
383 to_kind, array_length, elements_length); 383 to_kind, array_length, elements_length);
384 384
385 Factory* factory = isolate()->factory(); 385 Factory* factory = isolate()->factory();
386 386
387 AddInstruction(new(zone) HStoreNamedField(js_array, 387 AddInstruction(new(zone) HStoreNamedField(js_array,
388 factory->elements_field_string(), 388 factory->elements_field_string(),
389 new_elements, true, 389 new_elements, true,
390 JSArray::kElementsOffset)); 390 JSArray::kElementsOffset));
391 AddSimulate(BailoutId::StubEntry());
392 391
393 if_builder.End(); 392 if_builder.End();
394 393
395 AddInstruction(new(zone) HStoreNamedField(js_array, factory->length_string(), 394 AddInstruction(new(zone) HStoreNamedField(js_array, factory->length_string(),
396 map, true, JSArray::kMapOffset)); 395 map, true, JSArray::kMapOffset));
397 AddSimulate(BailoutId::StubEntry());
398 return js_array; 396 return js_array;
399 } 397 }
400 398
401 399
402 Handle<Code> TransitionElementsKindStub::GenerateCode() { 400 Handle<Code> TransitionElementsKindStub::GenerateCode() {
403 return DoGenerateCode(this); 401 return DoGenerateCode(this);
404 } 402 }
405 403
406 404
407 template <> 405 template <>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 current_block()->MarkAsDeoptimizing(); 438 current_block()->MarkAsDeoptimizing();
441 return GetParameter(0); 439 return GetParameter(0);
442 } 440 }
443 441
444 442
445 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { 443 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() {
446 return DoGenerateCode(this); 444 return DoGenerateCode(this);
447 } 445 }
448 446
449 } } // namespace v8::internal 447 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698