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

Side by Side Diff: src/parser.cc

Issue 6118001: Avoid calling inherited setters when creating object literals and their boilerplates. (Closed)
Patch Set: Address review comments Created 9 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 3642 matching lines...) Expand 10 before | Expand all | Expand 10 after
3653 return ReportUnexpectedToken(); 3653 return ReportUnexpectedToken();
3654 } 3654 }
3655 Handle<String> key = GetString(); 3655 Handle<String> key = GetString();
3656 if (scanner_.Next() != Token::COLON) { 3656 if (scanner_.Next() != Token::COLON) {
3657 return ReportUnexpectedToken(); 3657 return ReportUnexpectedToken();
3658 } 3658 }
3659 Handle<Object> value = ParseJsonValue(); 3659 Handle<Object> value = ParseJsonValue();
3660 if (value.is_null()) return Handle<Object>::null(); 3660 if (value.is_null()) return Handle<Object>::null();
3661 uint32_t index; 3661 uint32_t index;
3662 if (key->AsArrayIndex(&index)) { 3662 if (key->AsArrayIndex(&index)) {
3663 CALL_HEAP_FUNCTION_INLINE( 3663 SetOwnElement(json_object, index, value);
3664 (*json_object)->SetElement(index, *value, true));
3665 } else { 3664 } else {
3666 CALL_HEAP_FUNCTION_INLINE( 3665 SetLocalPropertyIgnoreAttributes(json_object, key, value, NONE);
3667 (*json_object)->SetPropertyPostInterceptor(*key, *value, NONE));
3668 } 3666 }
3669 } while (scanner_.Next() == Token::COMMA); 3667 } while (scanner_.Next() == Token::COMMA);
3670 if (scanner_.current_token() != Token::RBRACE) { 3668 if (scanner_.current_token() != Token::RBRACE) {
3671 return ReportUnexpectedToken(); 3669 return ReportUnexpectedToken();
3672 } 3670 }
3673 } 3671 }
3674 return json_object; 3672 return json_object;
3675 } 3673 }
3676 3674
3677 3675
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
4688 Handle<String> source = Handle<String>(String::cast(script->source())); 4686 Handle<String> source = Handle<String>(String::cast(script->source()));
4689 result = parser.ParseProgram(source, info->is_global()); 4687 result = parser.ParseProgram(source, info->is_global());
4690 } 4688 }
4691 } 4689 }
4692 4690
4693 info->SetFunction(result); 4691 info->SetFunction(result);
4694 return (result != NULL); 4692 return (result != NULL);
4695 } 4693 }
4696 4694
4697 } } // namespace v8::internal 4695 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698