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

Side by Side Diff: src/codegen-ia32.cc

Issue 18143: Change the handling of catch blocks to use context extension objects... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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 | « src/codegen-arm.cc ('k') | src/parser.cc » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2498 2498
2499 // Push the literal. 2499 // Push the literal.
2500 frame_->Push(ebx); 2500 frame_->Push(ebx);
2501 // Clone the boilerplate object. 2501 // Clone the boilerplate object.
2502 __ CallRuntime(Runtime::kCloneObjectLiteralBoilerplate, 1); 2502 __ CallRuntime(Runtime::kCloneObjectLiteralBoilerplate, 1);
2503 // Push the new cloned literal object as the result. 2503 // Push the new cloned literal object as the result.
2504 frame_->Push(eax); 2504 frame_->Push(eax);
2505 2505
2506 2506
2507 for (int i = 0; i < node->properties()->length(); i++) { 2507 for (int i = 0; i < node->properties()->length(); i++) {
2508 ObjectLiteral::Property* property = node->properties()->at(i); 2508 ObjectLiteral::Property* property = node->properties()->at(i);
2509 switch (property->kind()) { 2509 switch (property->kind()) {
2510 case ObjectLiteral::Property::CONSTANT: break; 2510 case ObjectLiteral::Property::CONSTANT: break;
2511 case ObjectLiteral::Property::COMPUTED: { 2511 case ObjectLiteral::Property::COMPUTED: {
2512 Handle<Object> key(property->key()->handle()); 2512 Handle<Object> key(property->key()->handle());
2513 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); 2513 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
2514 if (key->IsSymbol()) { 2514 if (key->IsSymbol()) {
2515 __ mov(eax, frame_->Top()); 2515 __ mov(eax, frame_->Top());
2516 frame_->Push(eax); 2516 frame_->Push(eax);
2517 Load(property->value()); 2517 Load(property->value());
2518 frame_->Pop(eax); 2518 frame_->Pop(eax);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 int offset = i * kPointerSize + Array::kHeaderSize; 2600 int offset = i * kPointerSize + Array::kHeaderSize;
2601 __ mov(FieldOperand(ecx, offset), eax); 2601 __ mov(FieldOperand(ecx, offset), eax);
2602 2602
2603 // Update the write barrier for the array address. 2603 // Update the write barrier for the array address.
2604 __ RecordWrite(ecx, offset, eax, ebx); 2604 __ RecordWrite(ecx, offset, eax, ebx);
2605 } 2605 }
2606 } 2606 }
2607 } 2607 }
2608 2608
2609 2609
2610 void CodeGenerator::VisitCatchExtensionObject(CatchExtensionObject* node) {
2611 // Call runtime routine to allocate the catch extension object and
2612 // assign the exception value to the catch variable.
2613 Comment cmnt(masm_, "[CatchExtensionObject ");
2614 Load(node->key());
2615 Load(node->value());
2616 __ CallRuntime(Runtime::kCreateCatchExtensionObject, 2);
2617 frame_->Push(eax);
2618 }
2619
2620
2610 bool CodeGenerator::IsInlineSmi(Literal* literal) { 2621 bool CodeGenerator::IsInlineSmi(Literal* literal) {
2611 if (literal == NULL || !literal->handle()->IsSmi()) return false; 2622 if (literal == NULL || !literal->handle()->IsSmi()) return false;
2612 int int_value = Smi::cast(*literal->handle())->value(); 2623 int int_value = Smi::cast(*literal->handle())->value();
2613 return is_intn(int_value, kMaxSmiInlinedBits); 2624 return is_intn(int_value, kMaxSmiInlinedBits);
2614 } 2625 }
2615 2626
2616 2627
2617 void CodeGenerator::VisitAssignment(Assignment* node) { 2628 void CodeGenerator::VisitAssignment(Assignment* node) {
2618 Comment cmnt(masm_, "[ Assignment"); 2629 Comment cmnt(masm_, "[ Assignment");
2619 CodeForStatement(node); 2630 CodeForStatement(node);
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after
5298 5309
5299 // Slow-case: Go through the JavaScript implementation. 5310 // Slow-case: Go through the JavaScript implementation.
5300 __ bind(&slow); 5311 __ bind(&slow);
5301 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 5312 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
5302 } 5313 }
5303 5314
5304 5315
5305 #undef __ 5316 #undef __
5306 5317
5307 } } // namespace v8::internal 5318 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen-arm.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698